unravel is package{

  unravel has type (%coll)=>(%left,%right) where
    sequence over %coll determines ((%l,%r)) 'n
    sequence over %left determines %l 'n
    sequence over %right determines %r;

  unravel(LL) is let{
    unravl(sequence of {},L,R) is (L,R);
    unravl(sequence of {(El,Er);..M},L,R) is unravl(M,sequence of {L..;El},sequence of {R..;Er})
  } in unravl(LL,sequence of {},sequence of {});
    
  main() do {
    Lin is array of {(1,"alpha"); (2,"beta"); (3,"gamma")};
    
    var (Lf,Rg) is unravel(Lin);
    
    assert Lf = array of {1;2;3};
    assert Rg = array of {"alpha";"beta";"gamma"};
  }
} 